<template>
	<view>
    <!-- <view id="top">
      <u-button type="warning" id="btn">导出所有</u-button>
    </view> -->
		<u-swipe-action :show="item.show" :index="index" 
			v-for="(item, index) in list" :key="item.id" 
			@click="click(item.id)"
			:options="options">
			<view class="item u-border-bottom">
				<view class="title-wrap u-font-50">
					{{ item.name }}
				</view>
			</view>
		</u-swipe-action>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [
					{
						id: 1,//简历id
						name:'陈新元',
						store:'2003060329',//学号
						qq:'2766799927',//QQ号
						
					},
					{
						id: 2,//简历id
						name:'陈新元',
						store:'2003060329',//学号
						qq:'2766799927',//QQ号
					},
				],
				
				disabled: false,
				btnWidth: 180,
				show: false,
				options: [
					{
						text: '查看',
						style: {
							backgroundColor: '#007aff'
						}
					},
				]
			};
		},
    onLoad(option) {
      let that = this
      this.class_one = option.class_one
      this.$request({
        url: '/stuinfors',
        data: {
          class_one: option.class_one
        },
        header: {
          'Authorization': "Bearer " + uni.getStorageSync('org_token')
        },
      }).then((res) => {
        if (res.code == 200) {
          that.list = res.data          
        }
      })
    },
		methods: {
			click(index) {
        if (this.class_one == '社团') {
          return uni.navigateTo({
            url: '/pages/stuSt/stuSt?id=' + index
          })
        }
				return uni.navigateTo({
					url: '/pages/stOrg/stOrg?id=' + index
				})
			},
			goStu(id){
				//这里做一个判断，从token里拿，如果为社团则跳到stuSt否则跳到stuOrg
				uni.navigateTo({
				  url: url+'?id='+id
				})
			},
      abab(e){
        console.log('agd:'+e)
      }
		}
	};
</script>

<style lang="scss" scoped>
 //  #top{
 //    width: 100vw;
 //    position: relative;
 //    top: 1100rpx;
 //  }
 //  #top, #btn{
 //    display: flex;
 //    flex-direction: column;
 //    align-items: content;
 //    justify-content: content;
 //  	// padding: 0 180rpx;
	// }
	// #btn{
	// 	// width: 400rpx;
 //  }
	.item {
		display: flex;
		padding: 20rpx;
	}
	image {
		width: 120rpx;
		flex: 0 0 120rpx;
		height: 120rpx;
		margin-right: 20rpx;
		border-radius: 12rpx;
	}
	.title {
		text-align: left;
		font-size: 28rpx;
		color: $u-content-color;
		margin-top: 20rpx;
	}
</style>